import request from '@/utils/request'

// 获取角色基本数据

export const getRoleList = (page, pagesize) => {
  return request.get('/sys/role', {
    params: {
      page,
      pagesize
    }
  })
}

// 增添角色
export const addRole = (obj) => {
  return request.post('/sys/role', obj)
}

// 更新角色信息
export const updateRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}

// 删除角色信息
export const delRole = (id) => {
  return request.delete(`/sys/role/${id}`)
}

// 获取角色详情
export const getRoleDetail = (id) => {
  return request.get(`/sys/role/${id}`)
}

// 分配角色权限
export const setRolePermission = (data) => {
  return request.put('/sys/role/assignPrem', data)
}
